import json

class JsonFileReader:
    def __init__(self, file_path):
        self.file_path = file_path

    def read_json_file(self):
        try:
            with open(self.file_path, 'r') as file:
                data = json.load(file)
            return data
        except FileNotFoundError:
            print(f"文件未找到: {self.file_path}")
            return None
        except json.JSONDecodeError:
            print(f"JSON 解码错误: {self.file_path}")
            return None

# 使用示例
if __name__ == "__main__":
    file_path = './api-key.json'
    reader = JsonFileReader(file_path)
    data = reader.read_json_file()
    if data is not None:
        print(data)
